import PageQuery from '@/store/extends/pageQuery'
import {observable, computed, action} from 'mobx'
import {createContext} from 'react'

class Singleparaminfo extends PageQuery {
  @observable pageQuery: {devId: string; paramCode: string} = {
    devId: '',
    paramCode: ''
  }
  @observable startTime: string = ''
  @observable endTime: string = ''

  @computed get getTimeRange() {
    return [this.startTime, this.endTime]
  }

  @action.bound
  handleTimeRangeChange(val: [string, string]) {
    val[0] && (this.startTime = val[0])
    val[1] && (this.endTime = val[1])
  }
}
export const SingleparaminfoStore = createContext(new Singleparaminfo())
